/**************************************************************************************************
	$Header: /pub/cvsroot/mydns/src/mydns/error.c,v 1.2 2002/07/24 12:30:34 bboy Exp $
	error.c: Routines to send error replies.

	Copyright (C) 2002  Don Moore <bboy@bboy.net>

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at Your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
**************************************************************************************************/

#include "named.h"


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	DNSERROR
	Generate error response for query and set status to NEED_SEND.  Always returns -1, as a
	convenience.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
int
dnserror(t, rcode)
	TASK *t;								/* The failed task */
	dns_rcode_t rcode;				/* The return code to use, such as DNS_R_SERVFAIL, etc. */
{
#if DEBUG
	Debug("%s: %s: %s", desctask(t), _("setting error response"), mydns_rcode_str(rcode));
#endif

	t->hdr.rcode = rcode;
	t->status = NEED_WRITE;

	return (-1);
}
/*--- dnserror() --------------------------------------------------------------------------------*/

/* vi:set ts=3: */
/* NEED_PO */
